home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / CTBUtilities.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  5.5 KB  |  221 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CTBUtilities.p
  3.  
  4.      Contains:    Communications Toolbox Utilities interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1988-1993, 1995-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT CTBUtilities;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CTBUTILITIES__}
  28. {$SETC __CTBUTILITIES__ := 1}
  29.  
  30. {$I+}
  31. {$SETC CTBUtilitiesIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __CONDITIONALMACROS__}
  35. {$I ConditionalMacros.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __MACTYPES__}
  38. {$I MacTypes.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __MIXEDMODE__}
  41. {$I MixedMode.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __DIALOGS__}
  44. {$I Dialogs.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __APPLETALK__}
  47. {$I AppleTalk.p}
  48. {$ENDC}
  49.  
  50.  
  51. {$PUSH}
  52. {$ALIGN MAC68K}
  53. {$LibExport+}
  54.  
  55.  
  56. CONST
  57.     curCTBUVersion                = 2;                            {  version of Comm Toolbox Utilities }
  58.  
  59.                                                                 {     Error codes/types     }
  60.     ctbuGenericError            = -1;
  61.     ctbuNoErr                    = 0;
  62.  
  63.  
  64. TYPE
  65.     CTBUErr                                = OSErr;
  66.  
  67. CONST
  68.     chooseDisaster                = -2;
  69.     chooseFailed                = -1;
  70.     chooseAborted                = 0;
  71.     chooseOKMinor                = 1;
  72.     chooseOKMajor                = 2;
  73.     chooseCancel                = 3;
  74.  
  75.  
  76. TYPE
  77.     ChooseReturnCode                    = UInt16;
  78.  
  79. CONST
  80.     nlOk                        = 0;
  81.     nlCancel                    = 1;
  82.     nlEject                        = 2;
  83.  
  84.  
  85. TYPE
  86.     NuLookupReturnCode                    = UInt16;
  87.  
  88. CONST
  89.     nameInclude                    = 1;
  90.     nameDisable                    = 2;
  91.     nameReject                    = 3;
  92.  
  93.  
  94. TYPE
  95.     NameFilterReturnCode                = UInt16;
  96.  
  97. CONST
  98.     zoneInclude                    = 1;
  99.     zoneDisable                    = 2;
  100.     zoneReject                    = 3;
  101.  
  102.  
  103. TYPE
  104.     ZoneFilterReturnCode                = UInt16;
  105.  
  106. CONST
  107.                                                                 {     Values for hookProc items         }
  108.     hookOK                        = 1;
  109.     hookCancel                    = 2;
  110.     hookOutline                    = 3;
  111.     hookTitle                    = 4;
  112.     hookItemList                = 5;
  113.     hookZoneTitle                = 6;
  114.     hookZoneList                = 7;
  115.     hookLine                    = 8;
  116.     hookVersion                    = 9;
  117.     hookReserved1                = 10;
  118.     hookReserved2                = 11;
  119.     hookReserved3                = 12;
  120.     hookReserved4                = 13;                            {     "virtual" hookProc items     }
  121.     hookNull                    = 100;
  122.     hookItemRefresh                = 101;
  123.     hookZoneRefresh                = 102;
  124.     hookEject                    = 103;
  125.     hookPreflight                = 104;
  126.     hookPostflight                = 105;
  127.     hookKeyBase                    = 1000;
  128.  
  129.  
  130. {    NuLookup structures/constants    }
  131.  
  132. TYPE
  133.     NLTypeEntryPtr = ^NLTypeEntry;
  134.     NLTypeEntry = RECORD
  135.         hIcon:                    Handle;
  136.         typeStr:                Str32;
  137.     END;
  138.  
  139.     NLType                                = ARRAY [0..3] OF NLTypeEntry;
  140.     NBPReplyPtr = ^NBPReply;
  141.     NBPReply = RECORD
  142.         theEntity:                EntityName;
  143.         theAddr:                AddrBlock;
  144.     END;
  145.  
  146. {$IFC TYPED_FUNCTION_POINTERS}
  147.     DialogHookProcPtr = FUNCTION(item: INTEGER; theDialog: DialogPtr): INTEGER;
  148. {$ELSEC}
  149.     DialogHookProcPtr = ProcPtr;
  150. {$ENDC}
  151.  
  152. {$IFC TYPED_FUNCTION_POINTERS}
  153.     NameFilterProcPtr = FUNCTION({CONST}VAR theEntity: EntityName): INTEGER;
  154. {$ELSEC}
  155.     NameFilterProcPtr = ProcPtr;
  156. {$ENDC}
  157.  
  158. {$IFC TYPED_FUNCTION_POINTERS}
  159.     ZoneFilterProcPtr = FUNCTION(theZone: Str32): INTEGER;
  160. {$ELSEC}
  161.     ZoneFilterProcPtr = ProcPtr;
  162. {$ENDC}
  163.  
  164.     DialogHookUPP = UniversalProcPtr;
  165.     NameFilterUPP = UniversalProcPtr;
  166.     ZoneFilterUPP = UniversalProcPtr;
  167.  
  168. CONST
  169.     uppDialogHookProcInfo = $000003A0;
  170.     uppNameFilterProcInfo = $000000E0;
  171.     uppZoneFilterProcInfo = $000000E0;
  172.  
  173. FUNCTION NewDialogHookProc(userRoutine: DialogHookProcPtr): DialogHookUPP;
  174.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  175.     INLINE $2E9F;
  176.     {$ENDC}
  177.  
  178. FUNCTION NewNameFilterProc(userRoutine: NameFilterProcPtr): NameFilterUPP;
  179.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  180.     INLINE $2E9F;
  181.     {$ENDC}
  182.  
  183. FUNCTION NewZoneFilterProc(userRoutine: ZoneFilterProcPtr): ZoneFilterUPP;
  184.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  185.     INLINE $2E9F;
  186.     {$ENDC}
  187.  
  188. FUNCTION CallDialogHookProc(item: INTEGER; theDialog: DialogPtr; userRoutine: DialogHookUPP): INTEGER;
  189.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  190.     INLINE $205F, $4E90;
  191.     {$ENDC}
  192.  
  193. FUNCTION CallNameFilterProc({CONST}VAR theEntity: EntityName; userRoutine: NameFilterUPP): INTEGER;
  194.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  195.     INLINE $205F, $4E90;
  196.     {$ENDC}
  197.  
  198. FUNCTION CallZoneFilterProc(theZone: Str32; userRoutine: ZoneFilterUPP): INTEGER;
  199.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  200.     INLINE $205F, $4E90;
  201.     {$ENDC}
  202. FUNCTION InitCTBUtilities: CTBUErr;
  203. FUNCTION CTBGetCTBVersion: INTEGER;
  204. FUNCTION StandardNBP(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  205. FUNCTION CustomNBP(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  206. {$IFC OLDROUTINENAMES }
  207. FUNCTION NuLookup(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  208. FUNCTION NuPLookup(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  209. {$ENDC}  {OLDROUTINENAMES}
  210.  
  211. {$ALIGN RESET}
  212. {$POP}
  213.  
  214. {$SETC UsingIncludes := CTBUtilitiesIncludes}
  215.  
  216. {$ENDC} {__CTBUTILITIES__}
  217.  
  218. {$IFC NOT UsingIncludes}
  219.  END.
  220. {$ENDC}
  221.